<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "{{%user_group}}".
 *
 * @property integer $gid
 * @property integer $id
 * @property string $name
 * @property integer $count
 */
class UserGroup extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%user_group}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'name', 'count'], 'required'],
            [['id', 'count'], 'integer'],
            [['name'], 'string', 'max' => 150],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'gid' => Yii::t('app', 'Gid'),
            'id' => Yii::t('app', 'id'),
            'name' => Yii::t('app', '名称'),
            'count' => Yii::t('app', '人数'),
        ];
    }

    /**
     * @inheritdoc
     * @return UserGroupQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new UserGroupQuery(get_called_class());
    }
}
